Generalized viewMajor() and viewMinor() into one function