Remove some redundant flow control
Organize imports