minor code clean up and test after changes