Finished refactoring, starting error fixing

The packages are finished, however errors still need to be
fixed/organized.