move key builder classmethods to simple functions