Reusable bash functions