Performance improvements (less queries) (closes #67)