Refactor for sanity.