Parallax js refactoring