moved rotation logic to model