Cleaned out unused functions and moved all code to DAL classes.