refactoring and additions