helper methods for registering scala instances and classes