rework Patterns and Loops and make them similar