Cleaned up the refactoring