Refactor functions to SLOA