refactor duplicated methods