Finished implemetation, refactoring and binding