Refactor

Moved message parsing and connection into seperate headers