I'll be making this functionality cleaner as part of LF-5041