refactoring (not well done) (cont'd)