cleanup and better module structure