factor out the object registry and use/catch runtime exceptions for error handling