refactor controller template and directory structures