better file pool implementation