code refactoring - good practices implementing