associativity bug fix
refactoring