Simplified bit of code in new functions