refactoring of some code fragments