removed private variables that were unneeded and unused and changed the constructor of applycontroller