Light refactoring and formatting improvement

Signed-off-by: Oren Leiman <oleiman@neutral.io>