Reduced redundant code

(belongs to issue #33)