decrease redundant code, dispose reader/writer