Refactored Factory and Commands