move client codes, minor changes in base