refactor a bit

Signed-off-by: Momchil Atanasov <m.momchil@gmail.com>