updated represent execute code to handle phtml correctly, also refactored it to see if i could make the code more readable.