Extracted out functionality to controllers