animation crossfade added, some refactors and fixes