Changed logic of marking. Now it doesn't need the Instance object.
Also refactored logic of post install actions..