fix and refactor later