cleaned up how code is being used