Adopted JavaScript best practices.