clean up formatting and try to throw basic errors