refactor code and use controller only when needed
more code refactor