Issues/18 refactoring

I will eat my dog food in a week :dog: