Refactored unused and unneeded code