refactored error messages
refactored error codes
deleted state file check, because it is inaccurate