command pattern added from javapapers