refactor beetl