Implement pattern handling. Add new comments.
Extend initialize layer by pattern manager.