Added convenience methods and using them in the tests and example code