Simplify action parameters and do some refactoring