Outline of how to refactor code.
Missing imports