(refactor) refactor from hell