DRYed the code slightly more. trying to start code tag support