major changes, refactoring