Refactored model class and added public functionality