-refactor code