refactored koden