some clenup and documentation