Add refactor and add comments to  mobile controller