Split object attribute assigning code into a function in Common module.
Simplify logic.
Implement /patch command.