Refactored some functions. Catching requests after first connection.