using to_class instead of to for adding subresource urls. adding support for event handlers