refactored execute method