started to consolidate functions into classes