Better structure

Cleaner and easier to maintain.
Only thing that comes to mind is checking the contents with a regex and then do `console.error(err.msg)`.