Minor refactoring

Signed-off-by: Sachith Seneviratne <sachith500@gmail.com>