Mike

moved logic into models