a lot of changes

refactoring