Refactor with levels