cleaning up webapp gui extracting javascript