added partials and clean more code