Changed action to an enum and added javadoc