got redis working and made code more modular