Refactoring/e strict

i started refactoring a little to get rid of a lot of E_STRICT warnings, as well as some resulting code cleanup, have a look and let me know what you think :)