separated cleanup functions into separate file