alert refactor in a single file
cleaning up. Index is the starting point