Refactored, XML comments improved