Fixed boken code. Performed some refactoring.