extract method
return something sensible when no matches found
remove unused command
update typeids + published items only

closes #23, #24