A principled approach to teaching mathematics in higher education