clean code
refactoring: simplify RPC call hanling + misc