cleaned up command parameters
transaction support
moving code around