Removing echo statements in favour of variables