factored invert value into condition
refactored Context class to be monobehaviour