refactored the models a bit, added new unit tests