refactor of methods