formatting

4 space indent + code flow rewrite for easier readability.