refactoring code and repo