refactor passing options to client; fix refresh