minor code clean up, probably needs a major cleanup