Restructure for easier implementation