Cleanup code in bars.lua