Need help in refactoring a RPC-literal type project