Create function on for register handler to element. Add test for private functions.