Refactored model to pyre