chef 12 and some minor refactor