Code cleanup, beginning to impl token authorization