code refactoring, length is not needed