cleaning up and refactoring

Change-Id: If3dd14b40614e154fcac1c1f6f423c8065f0469d
fixed jshint

Change-Id: I7db5621253d7cff6df0e1dc9e1d3cbaf70b2a52b
slower bird

Change-Id: I88faeab57d0144155841fe67f2a5e083e5334dab