#166 #194 #196 refactor of records... and related functions