Function refactoring, getting rid of sdController