Big refactor for the SMAA