fixing page transition animation
refactoring code to use module pattern