started to refactor the architecture