Adding some helper functions