factoring a better code base for block animation