Adding javascript and general best practices