Created functional interface for fsm functions.
Created single task which takes a  fsm method as parameter.