Changes after some reviews are done. Problematic is still that the JS can not be moved to an extra file because of the template tags in the code.