Refactoring
Added documentation