refactored (#02, #04, #06, #09) and completed #13