clean up metadata reading
move all methods that talk to db to one area. straight cut+paste
clean up get last string metric value