Comments typos fix.
Remove duplicated code.
Avoid unnecessary key_ field fetch.
Merge pull request #188 from d4mian/minor-changes

Comment typos, duplicate code removal and avoid unnecessary fetch of column key_ from the database.