a little bit of spaghetti cleanup, added masterAnimate