Moved user retrieval to seperate function