refactporing bet job