small code cleanup
moved pools' common logic in separate module