limit DOM access and function calls