Refactored into Gem file structure with classes instead of hashes