refactoring, nice for-loop