Added function wrapper for duplcated code