Re-factored a little bit, preparing for future LOGIN implementation