Tidied code from recent change