move methods to respective js templates