refactored/fixed some features