Moved inline js to a separate file