fairly modular, cleanup next