Refactored stuff and removed unneeded stuff