This `if` structure can be consolidated to one function call that gets passed in a few variables. It'll need the type of module ('backend', 'frontend') and based on that it can slice the correct piece out of the string.