implemented legacy code refactoring and new markup changes