findUser method created to avoid code duplication