Remove duplicated code in Gruntfile