mainly refactoring