Reduce code and make CodeShareCommand parent class