added training, cleaning, loading functions to client/server