Moved some widget functions to prototype for performance.