replace function with constructor in readme