some refactoring and a minor fix for the carbon floolight gui