big code refactor
changed serialEvent handling to in place mode
splitted to modules