remove useless copy of data
use const modifier where appropriate