brought sources for patterns out into seperate source files