Quick fix for not required query parameter and outsourcing parts of the handle in other functions for extenssion purposes