Some complexity reduction and simple refactors

- Reduce complexity of some if blocks
- Convert simple if then variable = to simple
- Combine nested if blocks that return the same into single or'd