diff --git a/gulp_tasks/checkstyle.js b/gulp_tasks/checkstyle.js
index bd76a8b..0826352 100644
--- a/gulp_tasks/checkstyle.js
+++ b/gulp_tasks/checkstyle.js
@@ -3,29 +3,28 @@
 
 'use strict';
 
-var options = require('../gulp-options.js'),
-    gulp = require('gulp'),
-    clean = require('gulp-clean'),
-    eslint = require('gulp-eslint');
+var options = require('../gulp-options.js'), gulp = require('gulp'),
+    clean = require('gulp-clean'), eslint = require('gulp-eslint');
 
-var runSequence = require('run-sequence'),
-    fs = require('fs');
+var runSequence = require('run-sequence'), fs = require('fs');
 
-gulp.task('checkstyle:clean', function () {
-    return gulp
-        .src([options.targetFolderPath + '/eslint-report-checkstyle.xml'], {'read': false})
-        .pipe(clean({'force': true}));
+gulp.task('checkstyle:clean', function() {
+  return gulp
+      .src(
+          [options.targetFolderPath + '/eslint-report-checkstyle.xml'],
+          {'read': false})
+      .pipe(clean({'force': true}));
 });
 
-gulp.task('checkstyle:eslint', function () {
-    return gulp
-        .src([options.srcFolderPath + '/**/*.js', options.excludePath])
-        .pipe(eslint({'useEslintrc': true}))
-        .pipe(eslint.format('checkstyle', function (output) {
-            fs.writeFileSync(options.targetFolderPath + '/eslint-report-checkstyle.xml', output);
-        }));
+gulp.task('checkstyle:eslint', function() {
+  return gulp.src([options.srcFolderPath + '/**/*.js', options.excludePath])
+      .pipe(eslint({'useEslintrc': true}))
+      .pipe(eslint.format('checkstyle', function(output) {
+        fs.writeFileSync(
+            options.targetFolderPath + '/eslint-report-checkstyle.xml', output);
+      }));
 });
 
-module.exports = function (callback) {
-    return runSequence('checkstyle:clean', 'checkstyle:eslint', callback);
+module.exports = function(callback) {
+  return runSequence('checkstyle:clean', 'checkstyle:eslint', callback);
 };
diff --git a/gulp_tasks/distribution.js b/gulp_tasks/distribution.js
index ec5aac0..c732eab 100644
--- a/gulp_tasks/distribution.js
+++ b/gulp_tasks/distribution.js
@@ -3,43 +3,40 @@
 
 'use strict';
 
-var options = require('../gulp-options.js'),
-    gulp = require('gulp'),
-    clean = require('gulp-clean'),
-    webapp = require('./webapp.js'),
+var options = require('../gulp-options.js'), gulp = require('gulp'),
+    clean = require('gulp-clean'), webapp = require('./webapp.js'),
     imagemin = require('gulp-imagemin');
 
 var runSequence = require('run-sequence');
 
-gulp.task('webapp', function (callback) {
-    return webapp(callback);
+gulp.task('webapp', function(callback) {
+  return webapp(callback);
 });
 
-gulp.task('distribution:clean', function () {
-    return gulp
-        .src([options.dirname + '/dist'], { 'read': false })
-        .pipe(clean({'force': true}));
+gulp.task('distribution:clean', function() {
+  return gulp.src([options.dirname + '/dist'], {'read': false}).pipe(clean({
+    'force': true
+  }));
 });
 
-gulp.task('distribution:copy', function () {
-    return gulp
-        .src(['**/*'], { 'cwd': options.targetFolderPath + '/webapp' })
-        .pipe(gulp.dest(options.dirname + '/dist'));
+gulp.task('distribution:copy', function() {
+  return gulp.src(['**/*'], {'cwd': options.targetFolderPath + '/webapp'})
+      .pipe(gulp.dest(options.dirname + '/dist'));
 });
 
-gulp.task('imagemin', () =>
-    gulp.src([options.dirname + '/app/assets/images/*'])
-        .pipe(imagemin({
-            optimizationLevel: 3,
-            progressive: true,
-            interlaced: false,
-            svgoPlugins: [{
-                removeViewBox: false
-            }]
-        }))
-        .pipe(gulp.dest('dist/assets/images'))
-);
+gulp.task(
+    'imagemin',
+    () => gulp.src([options.dirname + '/app/assets/images/*'])
+              .pipe(imagemin({
+                optimizationLevel: 3,
+                progressive: true,
+                interlaced: false,
+                svgoPlugins: [{removeViewBox: false}]
+              }))
+              .pipe(gulp.dest('dist/assets/images')));
 
-module.exports = function (callback) {
-    return runSequence('distribution:clean', 'webapp', 'distribution:copy', 'imagemin', callback);
+module.exports = function(callback) {
+  return runSequence(
+      'distribution:clean', 'webapp', 'distribution:copy', 'imagemin',
+      callback);
 };
diff --git a/gulp_tasks/minifyvendors.js b/gulp_tasks/minifyvendors.js
index 2819402..8c429a3 100644
--- a/gulp_tasks/minifyvendors.js
+++ b/gulp_tasks/minifyvendors.js
@@ -1,42 +1,32 @@
-
 /*eslint-env node */
 /*global require: true, module: true */
 
 'use strict';
 
-var options = require('../gulp-options.js'),
-    gulp = require('gulp'),
+var options = require('../gulp-options.js'), gulp = require('gulp'),
 
     // Base dependencies
-    clean = require('gulp-clean'),
-    rename = require('gulp-rename'),
+    clean = require('gulp-clean'), rename = require('gulp-rename'),
 
     // Classical gulp dependencies
     uglify = require('gulp-uglify');
 
 var runSequence = require('run-sequence');
 
-gulp.task('minifyvendorjs:clean', function () {
+gulp.task('minifyvendorjs:clean', function() {
   return gulp.src(options.bowerFolderPath + '/**/*.min.js', {read: false})
-    .pipe(clean());
+      .pipe(clean());
 });
 
-gulp.task('minifyvendorjs:minify', function () {
-    return gulp
-        .src(options.bowerFolderPath + '/**/*.js')
-        .pipe(uglify({
-            preserveComments: 'false'
-        }))
-        .pipe(rename({suffix: '.min'}))
-        .pipe(gulp.dest(function(file) {
-            return file.base;
-        }))
+gulp.task('minifyvendorjs:minify', function() {
+  return gulp.src(options.bowerFolderPath + '/**/*.js')
+      .pipe(uglify({preserveComments: 'false'}))
+      .pipe(rename({suffix: '.min'}))
+      .pipe(gulp.dest(function(file) {
+        return file.base;
+      }));
 });
 
-module.exports = function (callback) {
-    return runSequence(
-    	'minifyvendorjs:clean',
-        'minifyvendorjs:minify',
-        callback
-    );
-};
\ No newline at end of file
+module.exports = function(callback) {
+  return runSequence('minifyvendorjs:clean', 'minifyvendorjs:minify', callback);
+};
diff --git a/gulp_tasks/server.js b/gulp_tasks/server.js
index b965786..49fc013 100644
--- a/gulp_tasks/server.js
+++ b/gulp_tasks/server.js
@@ -1,32 +1,28 @@
-var options = require('../gulp-options.js'),
-    gulp = require('gulp'),
+var options = require('../gulp-options.js'), gulp = require('gulp'),
     connect = require('gulp-connect'),
     distribution = require('./distribution.js');
 
 var runSequence = require('run-sequence');
 
-gulp.task('distribution', function (callback) {
-    return distribution(callback);
+gulp.task('distribution', function(callback) {
+  return distribution(callback);
 });
 
 gulp.task('connect', function() {
-  connect.server({
-    root: 'dist',
-    livereload: true
-  });
+  connect.server({root: 'dist', livereload: true});
 });
 
 gulp.task('livereload', function() {
-  gulp.src(['./dist/**/*.html','./dist/**/*.js','./dist/**/*.css'])
-    .pipe(connect.reload());
+  gulp.src(['./dist/**/*.html', './dist/**/*.js', './dist/**/*.css'])
+      .pipe(connect.reload());
 });
 
-gulp.task('watch', function () {
-  gulp.watch('./app/**/*', function(callback){
+gulp.task('watch', function() {
+  gulp.watch('./app/**/*', function(callback) {
     return runSequence('distribution', 'livereload');
   });
 });
 
-module.exports = function (callback) {
-    return runSequence('connect', 'watch', callback);
-};
\ No newline at end of file
+module.exports = function(callback) {
+  return runSequence('connect', 'watch', callback);
+};
diff --git a/gulp_tasks/webapp.js b/gulp_tasks/webapp.js
index e514543..edeaff8 100644
--- a/gulp_tasks/webapp.js
+++ b/gulp_tasks/webapp.js
@@ -3,12 +3,10 @@
 
 'use strict';
 
-var options = require('../gulp-options.js'),
-    gulp = require('gulp'),
+var options = require('../gulp-options.js'), gulp = require('gulp'),
 
     // Base dependencies
-    clean = require('gulp-clean'),
-    rename = require('gulp-rename'),
+    clean = require('gulp-clean'), rename = require('gulp-rename'),
     util = require('gulp-util'),
 
     // Angular gulp dependencies
@@ -17,115 +15,99 @@
     ngConstant = require('gulp-ng-constant'),
 
     // Classical gulp dependencies
-    stripDebug = require('gulp-strip-debug'),
-    uglify = require('gulp-uglify'),
-    sass = require('gulp-sass'),
-    cleanCss = require('gulp-clean-css'),
-    rev = require('gulp-rev'),
-    revReplace = require('gulp-rev-replace'),
-    gulpIf = require('gulp-if'),
-    useref = require('gulp-useref'),
+    stripDebug = require('gulp-strip-debug'), uglify = require('gulp-uglify'),
+    sass = require('gulp-sass'), cleanCss = require('gulp-clean-css'),
+    rev = require('gulp-rev'), revReplace = require('gulp-rev-replace'),
+    gulpIf = require('gulp-if'), useref = require('gulp-useref'),
     jsoncombine = require('gulp-jsoncombine'),
     htmlParser = require('gulp-htmlparser');
 
 
-var runSequence = require('run-sequence'),
-    es = require('event-stream');
+var runSequence = require('run-sequence'), es = require('event-stream');
 
-gulp.task('webapp:clean', function () {
-    return gulp
-        .src([options.targetFolderPath + '/webapp', options.dirname + '/.temp'], { 'read': false })
-        .pipe(clean({'force': true}));
+gulp.task('webapp:clean', function() {
+  return gulp
+      .src(
+          [options.targetFolderPath + '/webapp', options.dirname + '/.temp'],
+          {'read': false})
+      .pipe(clean({'force': true}));
 });
 
-gulp.task('webapp:sasscompile', function () {
-    return gulp
-        .src('app/styles/index.scss')
-        .pipe(sass.sync().on('error', util.log))
-        .pipe(gulp.dest(options.srcFolderPath + '/styles'))
+gulp.task('webapp:sasscompile', function() {
+  return gulp.src('app/styles/index.scss')
+      .pipe(sass.sync().on('error', util.log))
+      .pipe(gulp.dest(options.srcFolderPath + '/styles'));
 });
 
 // ----- To .temp from app
-gulp.task('webapp:copyjs', function () {
-    return gulp.src(options.srcFolderPath + '/**/*.js')
-        .pipe(ngAnnotate()) // Check angular dependencies injection
-        .pipe(stripDebug()) // Remove all logs
-        .pipe(uglify({ 'mangle': false }))
-        .pipe(gulp.dest(options.dirname + '/.temp'));
+gulp.task('webapp:copyjs', function() {
+  return gulp.src(options.srcFolderPath + '/**/*.js')
+      .pipe(ngAnnotate())  // Check angular dependencies injection
+      .pipe(stripDebug())  // Remove all logs
+      .pipe(uglify({'mangle': false}))
+      .pipe(gulp.dest(options.dirname + '/.temp'));
 });
 
-gulp.task('webapp:copyothers', function () {
-    return gulp.src(['**/*', '!**/*.js', '!**/*.css', '!**/*.scss'], { 'cwd': options.srcFolderPath }) // All except JS files
-        .pipe(gulp.dest(options.tempFolderPath));
+gulp.task('webapp:copyothers', function() {
+  return gulp
+      .src(
+          ['**/*', '!**/*.js', '!**/*.css', '!**/*.scss'],
+          {'cwd': options.srcFolderPath})  // All except JS files
+      .pipe(gulp.dest(options.tempFolderPath));
 });
 
-gulp.task('webapp:copycss', function () {
-    return gulp
-        .src('app/styles/index.css')
-        .pipe(cleanCss())
-        .pipe(gulp.dest(options.tempFolderPath + '/styles'));
+gulp.task('webapp:copycss', function() {
+  return gulp.src('app/styles/index.css')
+      .pipe(cleanCss())
+      .pipe(gulp.dest(options.tempFolderPath + '/styles'));
 });
 
-gulp.task('webapp:constants', function () {
-    return gulp
-        .src('environment-constants.json')
-        .pipe(ngConstant({
-            'name': 'app.constants',
-            'deps': false
-        }))
-        .pipe(rename('environment-constants.js'))
-        .pipe(gulp.dest(options.tempFolderPath + '/constants'));
+gulp.task('webapp:constants', function() {
+  return gulp.src('environment-constants.json')
+      .pipe(ngConstant({'name': 'app.constants', 'deps': false}))
+      .pipe(rename('environment-constants.js'))
+      .pipe(gulp.dest(options.tempFolderPath + '/constants'));
 });
 
 // ----- To target/webapp from .temp and bower_components
-gulp.task('webapp:template', function () {
-    return gulp.src([options.srcFolderPath + '/**/*.html', '!' + options.srcFolderPath + '/index.html'])
-        .pipe(ngTemplateCache('templates.js', {
-            'module': 'app.templates',
-            'standalone': true
-        }))
-        .pipe(gulp.dest(options.tempFolderPath));
+gulp.task('webapp:template', function() {
+  return gulp
+      .src([
+        options.srcFolderPath + '/**/*.html',
+        '!' + options.srcFolderPath + '/index.html'
+      ])
+      .pipe(ngTemplateCache(
+          'templates.js', {'module': 'app.templates', 'standalone': true}))
+      .pipe(gulp.dest(options.tempFolderPath));
 });
 
-gulp.task('webapp:useref', function () {
-    var tasks = ['index.html'].map(function (indexPage) {
-        var assets = useref.assets({ });
+gulp.task('webapp:useref', function() {
+  var tasks = ['index.html'].map(function(indexPage) {
+    var assets = useref.assets({});
 
-        return gulp.src(options.tempFolderPath + '/' + indexPage)
-            .pipe(assets)
-            .pipe(assets.restore())
-            .pipe(useref())
-            .pipe(revReplace()) // Force useref to apply the 'rev' method
-            .pipe(gulp.dest(options.targetFolderPath + '/webapp'));
-    });
-
-    return es.concat.apply(null, tasks);
-});
-
-gulp.task('webapp:copyresources', function () {
-    return gulp.src(['**/*.*', '!**/*.js', '!**/*.css', '!**/*.html', '!**/*.log'], { 'cwd': options.tempFolderPath })
+    return gulp.src(options.tempFolderPath + '/' + indexPage)
+        .pipe(assets)
+        .pipe(assets.restore())
+        .pipe(useref())
+        .pipe(revReplace())  // Force useref to apply the 'rev' method
         .pipe(gulp.dest(options.targetFolderPath + '/webapp'));
+  });
+
+  return es.concat.apply(null, tasks);
 });
 
-module.exports = function (callback) {
-    return runSequence(
-        'webapp:clean',
-        'webapp:sasscompile',
-        [
-            'webapp:copyjs',
-            'webapp:copycss',
-            'webapp:copyothers'
-        ],
-        [
-            'webapp:constants',
-            'webapp:template'
-        ],
-        [
-            'webapp:useref'
-        ],
-        [
-            'webapp:copyresources'
-        ],
-        callback
-    );
+gulp.task('webapp:copyresources', function() {
+  return gulp
+      .src(
+          ['**/*.*', '!**/*.js', '!**/*.css', '!**/*.html', '!**/*.log'],
+          {'cwd': options.tempFolderPath})
+      .pipe(gulp.dest(options.targetFolderPath + '/webapp'));
+});
+
+module.exports = function(callback) {
+  return runSequence(
+      'webapp:clean', 'webapp:sasscompile',
+      ['webapp:copyjs', 'webapp:copycss', 'webapp:copyothers'],
+      ['webapp:constants', 'webapp:template'], ['webapp:useref'],
+      ['webapp:copyresources'], callback);
 };
