Update BufferPool.java

Refactored several methods in buffer pool.