delete main to separate functionality