restructuring sliding flight js file to be more readable
improving master template