added entity attribute to action
some redesign for nicer code
committing files