Refactored type signatures with a new type
Moved auth filtering into specific function