Major functionality simplification and refactoring