Refactoring
fixes #32