Clean up code, prep for handler conversion