Added logic and removed old static configuration