Code style cleanup. Refactor rules