refactored slightly and removed some unused methods/tests