refactor remote.jl