Refactor for sanity
Refactor for sanity