1.add bower support
2.optimize internal function