moved utlity methods into utils