Improve code patterns