New reusable functions to avoid repetition