factor filename stuff together