samll refactor