moving things out of index, cleaning up code with partials