refactored things, some marked as @deprecated