further improved error handling and implementation of rules, along with it's exception handling