You might be able to do this, but you are quite-frankly just making trouble for yourself – and for your colleagues who will eventually maintain the code – by doing something merely because it "tastes better" to you. There is no technical return-on-investment to compensate for the added uncertainty and complexity. "Some files are big, some files are small, and who cares." Just get it to
in the simplest and most-conventional way possible, and move on to your next task.