refactored ,add new file for class functions