Factored away "any" type. Reworked to use handlers.