Added more props and cleaned up the code