Same stuff with better patterns and less code