this should work with empty() ? "" : prefix + "." too and would be easier to read