Improved some control flow