refactoring some mroe