moved helper functions to lib directory