Partial code cleanup