Cleaning up references