smal refactoring