modualize and make it instance