Re structured class dependencies (to reduce code duplication) and code refactoring