Cleaned up white spaces and refactored tests