Miscellaneous revisions
Refactor