refactored basics