style(architecture): refactor core code