Re-factored config. Added wrote token. Refactored repo logic.