Some code cleanup

- Removed some useless code
- Moved some code to other places
- Changed a few things to make the code 'cleaner'

Signed-off-by: Swizzy <swizzy@hotmail.co.uk>