continuing refactoring

Change-Id: I5d114ede5988aef0098c33d53565a58e2791d63a
Signed-off-by: Marcelo Portilho <marceloport@gmail.com>