moved one require to method body to reduce static dependencies
added a conf option