refacter errbit.js to be more easily repeatable