Moved inline js to separate files