attempt to cleanup the code