Fix overlay update
Clean up code