refactoring and adding new things