Added addBinding and did some small refactors