Refactored code, change name of some components, create model for index