refactor by moving methods