refactor buggy so multiple instances can be created