Refactor basic code structure.