Refactored Command IO, fixed dtime bug