refactored to several layers and DCI setup