Source code tidied up