Refactoring

Closes #17