refactoring and stripping down