misc code clean up