moving more logic to controllers