refining the application script