Added logger, general optimizations, and refactoring performed in transmitter.