Need to set $db not $smc

rename private methods for consistency
minor formatting