Refactored to have only one logic for with or without space morse code encode.