you could make this code a bit clean by using ioService.write() - but this is just about aesthetics.