code refactor - part III

introducing jQuery promise