Tests & model code refactored.