refactoring, exceptions can occur with wrong data