Nested If Pseudocode, How to avoid such nesting with some checking or more efficient way.