fix functionality and cleanup