refactor complex methods