added stdout writer as a separate class