refactoring, fixes #42, fixes #55