Cleanup and remove unnecessary references