Add bdd implementation
Cleanup code