Cleaned up code on main page