Refactoring stuff to make the optional labels work