core refactor - reformat