refactor with slightly better debug options