Improved MVC like structure, added different error logging methods