some minor cleanup of the code