Make task work properly separated from an application