initial refactor

initial refactor to format