Issues/18 refactoring

I will eat my dog food in a few days :dog: