Cleaned up some code by putting some error.php stuff OO