refactor and simplify method