Revert "Revert "did some code cleanup""

Reverts skazer/WPBasalCart#2