templates refactoring + added missing code for item addition to store