Store long members in variable to improve readability
Separate unit filtering by checks

This code has grown too much to be embedded