rebuilt to fit CodeIgniter MVC-Pattern