Refactor js

Rewriting our js to be more readable and less hacky.


update related function so 'data.lastInterface && data.lastInterface == true"