Rewrote the conditional blocks to look neater and cleaner. More changes coming here.