Refactor code structure for a cleaner structure.