func. split up / clean up