getting rid of extra replace function