Split too big function to prevent pylint complains
Join two tests which anyway shared test data and most of the code
Improve code readability
Increase limit on number of return statements
Separate check views to own module