This commit extracts the function to a common method where it will be able to be used accross multiple drivers. Signed-off-by: André Carvalho <andre.carvalho@corp.globo.com>