Slightly refactored class and added ability to save to database