Add tests, gulp tests, reduce code a bit