Added execute file and code refactoring