minor changes to optimize things