Code style and factoring