Refactored to be more Ruby gem-like