Fixed variable shadowing warnings

 * fixed -Wshadow warnings
 * refactored some constructors