more separation of classes
slight cleanup of code