Remove unnecessary import
Major refactor of SAMR functions