Minor refactorings and bits

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>