Small refactoring

Sorry, I messed up #11, I replayed the commits to be clear.