wrap variables in correct stages

Everything but application needs to be done before running a binary
variable application is done afterwards