Code refactored (issue #82)