Tidied up helper method code to aid readability