move functioanlity and cleanup