Remove unneeded code, refacter, and dep removal