Code tidy

Splitting out inline js