Is this duplicate/unneeded code?