fixes for create_remote. code cleanup