Fix&Refactor deploy tasks