plugin pattern

implemented a useful plugin pattern