Added new functions to increase code reusability