Added basic act() function and factory pattern