remote: greatly simplified api and code itself