code refactoring beginnig2