Refactor a bit

Signed-off-by: Sharif Olorin <sio@tesser.org>