Major refactoring of the SLM