moved client specific input stream handling parts to the client files