Anvil. Code refactoring