added actions ; some refactoring