Refactor all architecture