add read and readMessage functions for some sugar