reduced duplicate code + expanded db