Did more refactoring