Large refactor and introduce partials