refactore split functiuonality