smal refact