Remove repeated section and make file path generic