cleanup of some code