This patter can be extracted to cons as it's used at least 2 times.