refactor and pray