first working release, refactoring