refactored builder, generator and locker