refactor coloured output as a method