Tidied code formatting