Implementation of some patterns and tests