Moved a lot of logic to DL from DAL