Improved Code Flow