Refactored part of the driller code