Tidied redundant code