Further cleanup of the code