Terminate when find EOL
Add connection layer
Simplify message function definition