Dapi/refactor