cleanup
set up environment detection