Added option for having multiple instance

Added option for having multiple instance and removed some useless code