refactor methods