Refactor some stuff

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