Added logging to file capabilities
Refactored purchase class