refactored a lot
basic login for editor works now