Fixed an efficiency problem in lumberctl and made did some refactoring