better import handling, and adding logout method