Add some exceptions throws
Some refactoring