code refactor
make partial more generic by taking variables instead of hard-coding