moved helper functions to a separate file.