split files and add specific error types

split files and add specific error types
fix mis-type