fixing and cleanup