moving helper methods into a separate file