Refactor, remove error-checking from all over the place