implemented .c outbuffer by refactoring