patterns implementation